Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 5 - Bitmap Shapes / Bitmap Shapes Reference
Functions / Editing Bitmaps


GXGetShapePixel

You can use the GXGetShapePixel function to determine the pixel value and the pixel offset of a specific pixel in a bitmap shape.

long GXGetShapePixel(gxShape source, long x, long y, 
                     gxColor *data, long *index);
source
A reference to the bitmap shape containing the pixel to examine.
x
The index of the column in which the pixel lies.
y
The index of the row in which the pixel lies.
data
A pointer to a gxColor structure. On return, this structure contains the color value of the specified pixel.
index
A pointer to a long value. On return, this value contains the color value of the specified pixel (if the pixel size of the bitmap is 16 or 32) or the specified pixel's index into the bitmap's color set (if the pixel size of the bitmap is 1, 2, 4, or 8).
function result
The index of the byte containing the specified pixel in the source bitmap's
pixel image.
DESCRIPTION
The GXGetShapePixel function copies the pixel value of the pixel determined by the x and y parameters from the source bitmap shape into the gxColor structure pointed to by the data parameter.

If the source bitmap shape has the gxKeepShapeDirect shape attribute set, this function also determines the pixel offset of the specified pixel and returns it in the long value pointed to by the index parameter. This function also returns a pointer to this value as the function result.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
Warnings 
shape_does_not_contain_a_bitmap(debugging only)
SEE ALSO
For information about the gxBitmap structure, see "The Bitmap Geometry Structure" beginning on page 5-62.

For information about pixels, pixel values, and pixel offsets, see "Bitmap Geometries" beginning on page 5-5.

To examine more than a single pixel of a bitmap, use the GXGetBitmapParts function, which is described on page 5-74.

To change the value of a pixel, use the GXSetShapePixel function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help